]> permondes.de Git - Analog_Engine.git/blob - scripts/EP1 04.02 Starting a Rocket_b.LACE
Throwing a stone on earth, starting a rocket from earth
[Analog_Engine.git] / scripts / EP1 04.02 Starting a Rocket_b.LACE
1 # A rocket is started from the surface of the earth. Calculating the height as function of its mass and fuel consumption.
2 # Approximation of acceleration with Taylor series
3 # Equation of motion
4 # r'' = (alpha / m0)*v0 + (alpha/m0)²*v0*t - gamma * ME / r²
5 # alpha: fuel consumption, e.g. 2000t in 2,5 min = 13,333*10^3 kg/s
6 # m0: initial mass of rocket, e.g. Saturn V: 2900 t = 2,9*10^6 kg
7 # v0: the velocity of the exhaust of the rocket: 3,180*10^3 m/s
8 # gamma: gravitational constant: 6,6743E-11 m³/(kg*s²)
9 # ME: mass of earth: 5,97E+24 kg
10
11 # include idivide
12 include CompoundFunctions.LACE
13
14 coefficient.1(+1) -> alpha/m0*v0
15 coefficient.2(+1) -> (alpha/m0)^2*v0
16 coefficient.3 -> scale
17 coefficient.4(-1) -> -RE
18 coefficient.5(+1) -> 10*gamma*ME
19
20 # generate t-ramp
21 iintegrate (-1) -> t
22
23 # calculating altitude
24 iintegrate (alpha/m0*v0, (alpha/m0)^2*v0*t, -gamma*ME/r^2) -> -v # input is a ### 3. Term fehlen noch ###
25 cmultiply (scale, -v) -> -v.scaled
26 iintegrate (-v) -> r
27 IC: -RE
28
29 # calculating acceleration
30 multiply (r,r) -> r^2
31 idivide (10*gamma*ME, r^2) -> -10*gamma*ME/r^2
32
33 cmultiply ((alpha/m0)^2*v0, t) -> (alpha/m0)^2*v0*t
34
35 # inverting velocity for display
36 invert (-v.scaled) -> v.scaled
37
38 # subtracting the radius of earth in order to get altitude above ground for display
39 isum (-RE, r) -> -z
40 invert (-z) -> z
41
42 output (t) -> out.x
43 output (v) -> out.y
44 output (z) -> out.z